package com.ruoyi.web.service.impl;

import com.ruoyi.web.dto.ChargingRecordsDto;
import com.ruoyi.web.entity.ChargingRecords;
import com.ruoyi.web.mapper.ChargingRecordsMapper;
import com.ruoyi.web.service.IChargingRecordsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-02-01
 */
@Service
public class ChargingRecordsServiceImpl extends ServiceImpl<ChargingRecordsMapper, ChargingRecords> implements IChargingRecordsService {

    private final ChargingRecordsMapper chargingRecordsMapper;
    public ChargingRecordsServiceImpl(ChargingRecordsMapper chargingRecordsMapper){
        this.chargingRecordsMapper = chargingRecordsMapper;
    }
    /**
     * 查询充电记录
     *
     * @param id 充电记录主键
     * @return 充电记录
     */
    @Override
    public ChargingRecordsDto selectChargingRecordsById(Long id)
    {
        return chargingRecordsMapper.selectChargingRecordsById(id);
    }

    /**
     * 查询充电记录列表
     *
     * @param chargingRecords 充电记录
     * @return 充电记录
     */
    @Override
    public List<ChargingRecordsDto> selectChargingRecordsList(ChargingRecords chargingRecords)
    {
        return chargingRecordsMapper.selectChargingRecordsList(chargingRecords);
    }

    /**
     * 新增充电记录
     *
     * @param chargingRecords 充电记录
     * @return 结果
     */
    @Override
    public int insertChargingRecords(ChargingRecords chargingRecords)
    {
        return chargingRecordsMapper.insertChargingRecords(chargingRecords);
    }

    /**
     * 修改充电记录
     *
     * @param chargingRecords 充电记录
     * @return 结果
     */
    @Override
    public int updateChargingRecords(ChargingRecords chargingRecords)
    {
        return chargingRecordsMapper.updateChargingRecords(chargingRecords);
    }

    /**
     * 批量删除充电记录
     *
     * @param ids 需要删除的充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargingRecordsByIds(Long[] ids)
    {
        return chargingRecordsMapper.deleteChargingRecordsByIds(ids);
    }

    /**
     * 删除充电记录信息
     *
     * @param id 充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargingRecordsById(Long id)
    {
        return chargingRecordsMapper.deleteChargingRecordsById(id);
    }
}
